package com.dolphin.common.util;

public class RedisPrefixUtils {
    //乘客验证码的前缀
    public static String verificationCodePrefix = "verification-code-";
    public static String tokenPrefix = "token-";

    //黑名单设备号前缀
    public static String blackDevicePrefix = "black-device-";
    /**
     * 根据手机号，生成key
     * @param phone
     * @param identity
     * @return
     */
    public static String generatorKeyByPhone(String phone,String identity) {
        return verificationCodePrefix + identity +"-" + phone;
    }

    /**
     * 根据手机号和身份标识生成token的key
     * @param phone
     * @param identity
     * @return
     */
    public static String generatorTokenKey(String phone, String identity,  String tokenType) {
        return tokenPrefix+phone+"-"+identity+"-"+tokenType;
    }
}
